/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package estructuras;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;

/**
 *
 * @author Felipe Serrano
 */
public class TestBench {
    protected int tamEntradasTB;
    protected int numEntradasTB;
    protected String ficheroTB;
    protected BufferedReader bf;
    protected ArrayList<String> lstEntradasTB;
    
    
    public TestBench(String name){
        ficheroTB = name;
        lstEntradasTB = new ArrayList<>();
    }
    
    
    public String getEntradaTB(int i){
        return lstEntradasTB.get(i);
    }
    
    public int getNumEntradasTB(){return numEntradasTB;}
    
    
    
    public boolean leerTB(){
        String linea;
        try {
            bf = new BufferedReader(new FileReader(ficheroTB));
            linea = bf.readLine();
            while(linea != null){
                lstEntradasTB.add(linea);
                numEntradasTB++;
                linea = bf.readLine();
            }
            bf.close();
            tamEntradasTB = lstEntradasTB.get(0).length();
            return true;
        } catch (Exception ex) {
            System.out.println("Asdasd");
            return false;
        }
    }
    
}
